package cn.itsource.hrm.feignclients;

import cn.itsource.hrm.doc.CourseDoc;
import cn.itsource.hrm.fallback.ESFeignClientFallbackFactory;
import cn.itsource.hrm.query.CourseQuery;
import cn.itsource.hrm.util.AjaxResult;
import cn.itsource.hrm.util.PageList;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "es-server",fallbackFactory = ESFeignClientFallbackFactory.class)//写远程调用的服务名
public interface ESFeignClient {
    //写上要调用的远程的方法，不要方法体
    @PostMapping("/es/save")
    public AjaxResult save(@RequestBody CourseDoc courseDoc);

    @DeleteMapping("/es/deleteById/{id}")
    public AjaxResult deleteById(@PathVariable("id") Long id);

    @PostMapping("/es/searchCourse")
    PageList<CourseDoc> searchCourse(@RequestBody CourseQuery courseQuery);
}
